package cn.stylefeng.guns.modular.order.service;

import java.io.IOException;
import java.util.List;

import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.web.multipart.MultipartFile;

import com.baomidou.mybatisplus.extension.service.IService;

import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
import cn.stylefeng.guns.modular.order.entity.OrderPut;
import cn.stylefeng.guns.modular.order.entity.OrderPutExcelItem;
import cn.stylefeng.guns.modular.order.model.params.OrderPutParam;
import cn.stylefeng.guns.modular.order.model.result.OrderPutResult;
import cn.stylefeng.guns.sys.modular.system.entity.User;
import cn.stylefeng.roses.core.reqres.response.ResponseData;

/**
 * 入库订单表 服务类
 */
public interface OrderPutService extends IService<OrderPut> {

    /**
     * 新增
     *
     * @author zhucx
     * @Date 2019-07-02
     */
    void add(OrderPutParam param);

    /**
     * 删除
     *
     * @author zhucx
     * @Date 2019-07-02
     */
    void delete(OrderPutParam param);

    /**
     * 更新
     *
     * @author zhucx
     * @Date 2019-07-02
     */
    void update(OrderPutParam param);

    /**
     * 查询单条数据，Specification模式
     *
     * @author zhucx
     * @Date 2019-07-02
     */
    OrderPutResult findBySpec(OrderPutParam param,Long operateId);

    /**
     * 查询列表，Specification模式
     *
     * @author zhucx
     * @Date 2019-07-02
     */
    List<OrderPutResult> findListBySpec(OrderPutParam param,Long operateId);

    /**
     * 查询分页数据，Specification模式
     *
     * @author zhucx
     * @Date 2019-07-02
     */
     LayuiPageInfo findPageBySpec(OrderPutParam param,String condition,Long operateId);

     /**
      * 查询最后一条记录
      * @return OrderPut
      */
	OrderPut findByThelastone();

	/**
	 * 校验客户单号 是否存在
	 * @param putCustomerNumber
	 * @return
	 */
	boolean checkCustomerOrder(String putCustomerNumber);

	LayuiPageInfo querylistPageBySpec(OrderPutParam orderPutParam, String condition,Long operateId);
	
	/**
	 * 批量保存list
	 * @param List<OrderPutParam>
	 * @return
	 */
	boolean saveBatchList(List<OrderPutParam> list);

	/**
	 * 处理导入数据
	 * @param file
	 * @param data
	 * @return
	 * @throws IOException 
	 */
	ResponseData getExceldata(MultipartFile file, OrderPutParam orderPutParam,ResponseData data) throws Exception;

	/**
	 * 撤回入库订单
	 */
	ResponseData revokeS(OrderPut orderPut, ResponseData data);

	ResponseData revokeS2(OrderPut orderPut, ResponseData data,User user);

	/**
	 * 撤回直接入库
	 * @param orderPut
	 * @param data
	 * @return
	 */
	ResponseData revokeStrides(OrderPut orderPut, ResponseData data);

	OrderPutResult getPrintOrderPut(OrderPutParam orderPutParam);

	ResponseData savePulljstputorder(User user,OrderPutParam orderPutParam, List<OrderPutExcelItem> list);

	ResponseData savePulljstreturngoods(OrderPutParam orderPutParam, List<OrderPutExcelItem> list);

	Workbook exportToExcel(OrderPutParam orderPutParam);

	ResponseData getExceldataLY(MultipartFile file, OrderPutParam orderPutParam, ResponseData data) throws Exception;
}
